cnum.evaluate   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
crap 1
1 1
import VERSION from './version'
2 1
import Lexer from './Lexer'
3 1
import Parser from './Parser'
4
5
/**
6
 * @class Comfortably Numbers
7
 * @name cnum
8
 */
9
class cnum {
10
  static get version(): string {
11 1
    return VERSION
12
  }
13
14
  static evaluate(expression: string): string {
15 2
    const lexer = new Lexer(expression)
16 2
    const parser = new Parser(lexer.lex())
17 2
    return parser.toString()
18
  }
19
}
20
21 1
export default cnum
22 3
export { Rat, floatToRat, parseRat } from './Rat'
23
export { Polyrat } from './Polyrat'
24